const { dataUrl } = require("./env");

export const setStoage = (userId, token, username, userImage) => {
  window.sessionStorage.setItem("userId", userId);
  window.sessionStorage.setItem("token", token);
  window.sessionStorage.setItem("username", username);
  window.sessionStorage.setItem("userImage", dataUrl + userImage);
};

export const getStoageIsLogin = () => {
  const token = window.sessionStorage.getItem("token");
  if (token) {
    return true;
  }
  return false;
};

export const removeStoageToken = () => {
  window.sessionStorage.removeItem("token");
};

export const setStoageImage = (userImage) => {
  window.sessionStorage.setItem("userImage", dataUrl + userImage);
};
